package com.celan.year2023.month01.day08;

public class Solution {
    /**
     * leetcode2185
     */
    public int prefixCount(String[] words, String pref) {
        int n = pref.length();
        int cnt = 0;
        for (String word : words) {
            if (word.length() < n) continue;
            String sub = word.substring(0, n);
            if(sub.equals(pref))cnt++;
        }
        return cnt;
    }
}
